package javaLearning.SystemProperties;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Map;
import java.util.Properties;

/**
 * @description: 获取系统变量
 *
 * @author: Kk
 * @create: 2020-12-20 13:37
 **/
public class Demo {
    public static void main(String[] args) {
        //获取系统环境变量
        Map<String, String> getenv = System.getenv();
        //获取运行环境变量  如项目路径：参数为usr.dir
        Properties properties = System.getProperties();

        LocalDateTime now = LocalDateTime.now();
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        System.out.println(now.format(dateTimeFormatter));
    }
}
